﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="MenuItem" table="cmsMenuItem">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="StartPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="StartPublishing" not-null="false" />
    </property>
    <property name="EndPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EndPublishing" not-null="false" />
    </property>
    <property name="SortIndex" type="System.Int32">
      <column name="SortIndex" not-null="true" />
    </property>
    <property name="LinkType" type="NHibernate.Type.EnumStringType`1[[Cms.Domain.MenuItemLinkType, Cms.Domain]], NHibernate">
      <column name="LinkType" length="20" not-null="true" />
    </property>
    <property name="Target" type="System.String">
      <column name="Target" length="20" not-null="false" />
    </property>
    <bag cascade="save-update" inverse="true" name="SubItems" order-by="SortIndex">
      <cache usage="read-write" />
      <key>
        <column name="ParentID" />
      </key>
      <one-to-many class="MenuItem" />
    </bag>
    <map name="Translations" table="cmsMenuItemTranslation" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="MenuItemID" />
      </key>
      <index type="System.Int32">
        <column name="LocaleID" />
      </index>
      <composite-element class="MenuItemTranslation">
        <property name="Name" type="System.String">
          <column name="Name" length="255" not-null="true" />
        </property>
        <property name="Url" type="System.String">
          <column name="Url" length="1000000" not-null="false" />
        </property>
        <many-to-one class="MediaFile" name="DefaultImage">
          <column name="DefaultImageID" not-null="false" />
        </many-to-one>
        <many-to-one class="MediaFile" name="DefaultHoverImage">
          <column name="DefaultHoverImageID" not-null="false" />
        </many-to-one>
        <many-to-one class="MediaFile" name="ActiveImage">
          <column name="ActiveImageID" not-null="false" />
        </many-to-one>
        <many-to-one class="MediaFile" name="ActiveHoverImage">
          <column name="ActiveHoverImageID" not-null="false" />
        </many-to-one>
      </composite-element>
    </map>
    <many-to-one class="MenuVersion" name="Version">
      <column name="MenuVersionID" not-null="true" />
    </many-to-one>
    <many-to-one class="MenuItem" name="Parent">
      <column name="ParentID" />
    </many-to-one>
    <many-to-one class="Page" fetch="join" name="Page">
      <column name="PageID" not-null="false" />
    </many-to-one>
    <many-to-one class="MediaFile" name="MediaFile">
      <column name="MediaFileID" not-null="false" />
    </many-to-one>
    <many-to-one class="Category" name="ActiveForPagesInCategory">
      <column name="ActiveForPagesInCategoryID" />
    </many-to-one>
  </class>
</hibernate-mapping>